/* CSS变量定义 - 默认深色主题 */
:root {
    --primary-color: #64b5f6;
    --secondary-color: #81c784;
    --bg-gradient: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    --container-bg: rgba(52, 73, 94, 0.95);
    --text-color: #ecf0f1;
    --text-light: #bdc3c7;
    --border-color: #34495e;
    --upload-bg: linear-gradient(145deg, #34495e 0%, #2c3e50 100%);
    --upload-hover: linear-gradient(145deg, #3c5a78 0%, #34495e 100%);
    --upload-dragover: linear-gradient(145deg, #4a6fa5 0%, #3c5a78 100%);
    --shadow-color: rgba(0, 0, 0, 0.3);
    --accent-opacity: 0.15;
}

/* 原默认主题 */
.theme-default {
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --bg-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --container-bg: rgba(255, 255, 255, 0.95);
    --text-color: #333;
    --text-light: #666;
    --border-color: #e0e0e0;
    --upload-bg: linear-gradient(145deg, #f8f9ff 0%, #ffffff 100%);
    --upload-hover: linear-gradient(145deg, #f0f2ff 0%, #f8f9ff 100%);
    --upload-dragover: linear-gradient(145deg, #e8ebff 0%, #f0f2ff 100%);
    --shadow-color: rgba(0, 0, 0, 0.15);
    --accent-opacity: 0.1;
}

/* 护眼白色主题 */
.theme-light {
    --primary-color: #4a90e2;
    --secondary-color: #7b68ee;
    --bg-gradient: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    --container-bg: rgba(255, 255, 255, 0.98);
    --text-color: #2c3e50;
    --text-light: #6c757d;
    --border-color: #dee2e6;
    --upload-bg: linear-gradient(145deg, #ffffff 0%, #f8f9fa 100%);
    --upload-hover: linear-gradient(145deg, #f1f3f4 0%, #ffffff 100%);
    --upload-dragover: linear-gradient(145deg, #e3f2fd 0%, #f1f3f4 100%);
    --shadow-color: rgba(0, 0, 0, 0.08);
    --accent-opacity: 0.05;
}

/* 护眼深色主题 */
.theme-dark {
    --primary-color: #64b5f6;
    --secondary-color: #81c784;
    --bg-gradient: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    --container-bg: rgba(52, 73, 94, 0.95);
    --text-color: #ecf0f1;
    --text-light: #bdc3c7;
    --border-color: #34495e;
    --upload-bg: linear-gradient(145deg, #34495e 0%, #2c3e50 100%);
    --upload-hover: linear-gradient(145deg, #3c5a78 0%, #34495e 100%);
    --upload-dragover: linear-gradient(145deg, #4a6fa5 0%, #3c5a78 100%);
    --shadow-color: rgba(0, 0, 0, 0.3);
    --accent-opacity: 0.15;
}

/* 护眼绿色主题 */
.theme-green {
    --primary-color: #4caf50;
    --secondary-color: #66bb6a;
    --bg-gradient: linear-gradient(135deg, #e8f5e8 0%, #c8e6c9 100%);
    --container-bg: rgba(255, 255, 255, 0.95);
    --text-color: #2e7d32;
    --text-light: #4caf50;
    --border-color: #a5d6a7;
    --upload-bg: linear-gradient(145deg, #f1f8e9 0%, #ffffff 100%);
    --upload-hover: linear-gradient(145deg, #e8f5e8 0%, #f1f8e9 100%);
    --upload-dragover: linear-gradient(145deg, #c8e6c9 0%, #e8f5e8 100%);
    --shadow-color: rgba(76, 175, 80, 0.15);
    --accent-opacity: 0.1;
}

/* 护眼蓝色主题 */
.theme-blue {
    --primary-color: #2196f3;
    --secondary-color: #42a5f5;
    --bg-gradient: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    --container-bg: rgba(255, 255, 255, 0.95);
    --text-color: #0d47a1;
    --text-light: #1976d2;
    --border-color: #90caf9;
    --upload-bg: linear-gradient(145deg, #f3f9ff 0%, #ffffff 100%);
    --upload-hover: linear-gradient(145deg, #e3f2fd 0%, #f3f9ff 100%);
    --upload-dragover: linear-gradient(145deg, #bbdefb 0%, #e3f2fd 100%);
    --shadow-color: rgba(33, 150, 243, 0.15);
    --accent-opacity: 0.1;
}

/* 护眼紫色主题 */
.theme-purple {
    --primary-color: #9c27b0;
    --secondary-color: #ba68c8;
    --bg-gradient: linear-gradient(135deg, #f3e5f5 0%, #e1bee7 100%);
    --container-bg: rgba(255, 255, 255, 0.95);
    --text-color: #4a148c;
    --text-light: #7b1fa2;
    --border-color: #ce93d8;
    --upload-bg: linear-gradient(145deg, #fce4ec 0%, #ffffff 100%);
    --upload-hover: linear-gradient(145deg, #f3e5f5 0%, #fce4ec 100%);
    --upload-dragover: linear-gradient(145deg, #e1bee7 0%, #f3e5f5 100%);
    --shadow-color: rgba(156, 39, 176, 0.15);
    --accent-opacity: 0.1;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg-gradient);
    background-attachment: fixed;
    min-height: 100vh;
    padding: 20px;
    position: relative;
    overflow-x: hidden;
    transition: all 0.3s ease;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="%23ffffff" opacity="0.1"/><circle cx="75" cy="75" r="1" fill="%23ffffff" opacity="0.1"/><circle cx="50" cy="10" r="0.5" fill="%23ffffff" opacity="0.15"/><circle cx="10" cy="60" r="0.5" fill="%23ffffff" opacity="0.15"/><circle cx="90" cy="40" r="0.5" fill="%23ffffff" opacity="0.15"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>') repeat;
    pointer-events: none;
    z-index: -1;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    background: var(--container-bg);
    backdrop-filter: blur(20px);
    border-radius: 25px;
    box-shadow: 0 25px 50px var(--shadow-color), 0 0 0 1px rgba(255, 255, 255, 0.1);
    overflow: hidden;
    animation: containerFadeIn 0.8s ease-out;
    position: relative;
    transition: all 0.3s ease;
}

.container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color), var(--primary-color));
    background-size: 200% 100%;
    animation: shimmer 3s ease-in-out infinite;
}

/* 主题切换按钮 */
.theme-switcher {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    background: var(--container-bg);
    border-radius: 15px;
    padding: 10px;
    box-shadow: 0 10px 25px var(--shadow-color);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.theme-switcher:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 35px var(--shadow-color);
}

.theme-toggle-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 10px;
    transition: all 0.3s ease;
    color: var(--text-color);
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
}

.theme-toggle-btn:hover {
    background: var(--primary-color);
    color: white;
    transform: scale(1.1);
}

.theme-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 10px;
    background: var(--container-bg);
    border-radius: 15px;
    padding: 15px;
    box-shadow: 0 15px 35px var(--shadow-color);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.theme-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.theme-option {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 5px;
    color: var(--text-color);
}

.theme-option:hover {
    background: var(--upload-hover);
    transform: translateX(5px);
}

.theme-option.active {
    background: var(--primary-color);
    color: white;
}

.theme-color {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    margin-right: 10px;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.theme-default .theme-color { background: linear-gradient(45deg, #667eea, #764ba2); }
.theme-light .theme-color { background: linear-gradient(45deg, #f8f9fa, #4a90e2); }
.theme-dark .theme-color { background: linear-gradient(45deg, #2c3e50, #64b5f6); }
.theme-green .theme-color { background: linear-gradient(45deg, #4caf50, #66bb6a); }
.theme-blue .theme-color { background: linear-gradient(45deg, #2196f3, #42a5f5); }
.theme-purple .theme-color { background: linear-gradient(45deg, #9c27b0, #ba68c8); }

@keyframes containerFadeIn {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes shimmer {
    0%, 100% { background-position: 200% 0; }
    50% { background-position: -200% 0; }
}

h1 {
    text-align: center;
    padding: 40px 30px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    font-size: 2.8em;
    font-weight: 300;
    margin: 0;
    position: relative;
    overflow: hidden;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

h1::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    animation: titleShine 3s ease-in-out infinite;
}

@keyframes titleShine {
    0% { left: -100%; }
    50% { left: 100%; }
    100% { left: 100%; }
}

.upload-section {
    padding: 40px;
}

.upload-area {
    border: 3px dashed var(--primary-color);
    border-radius: 20px;
    padding: 60px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    background: var(--upload-bg);
    position: relative;
    overflow: hidden;
}

.upload-area::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(102, 126, 234, var(--accent-opacity)) 50%, transparent 70%);
    transform: translateX(-100%);
    transition: transform 0.6s ease;
}

.upload-area:hover {
    border-color: var(--secondary-color);
    background: var(--upload-hover);
    transform: translateY(-5px);
    box-shadow: 0 15px 35px var(--shadow-color);
}

.upload-area:hover::before {
    transform: translateX(100%);
}

.upload-area.dragover {
    border-color: var(--secondary-color);
    background: var(--upload-dragover);
    transform: scale(1.02) translateY(-3px);
    box-shadow: 0 20px 40px var(--shadow-color);
    animation: pulse 1s ease-in-out infinite alternate;
}

@keyframes pulse {
    from { box-shadow: 0 20px 40px var(--shadow-color); }
    to { box-shadow: 0 25px 50px var(--shadow-color); }
}

.upload-content {
    pointer-events: none;
}

.upload-icon {
    width: 64px;
    height: 64px;
    color: var(--primary-color);
    margin-bottom: 20px;
    transition: all 0.3s ease;
}

.upload-area p {
    font-size: 1.2em;
    color: var(--text-color);
    margin-bottom: 10px;
}

.upload-hint {
    font-size: 0.9em !important;
    color: var(--text-light) !important;
}

.settings-section {
    padding: 40px;
    border-top: 1px solid var(--border-color);
}

.settings-section h3 {
    color: var(--text-color);
    margin-bottom: 20px;
    font-size: 1.3em;
    font-weight: 500;
}

.format-options, .naming-options {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.format-option, .naming-option {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 12px 20px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    transition: all 0.3s ease;
    background: var(--container-bg);
    color: var(--text-color);
}

.format-option:hover, .naming-option:hover {
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.2);
}

.format-option input, .naming-option input {
    margin-right: 10px;
    accent-color: #667eea;
}

.format-option input:checked + span,
.naming-option input:checked + span {
    color: #667eea;
    font-weight: 600;
}

.format-option:has(input:checked),
.naming-option:has(input:checked) {
    border-color: #667eea;
    background: #f8f9ff;
}

.custom-naming {
    margin-top: 20px;
    padding: 20px;
    background: #f8f9ff;
    border-radius: 10px;
    border: 1px solid #e0e7ff;
}

.custom-naming input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1em;
    transition: border-color 0.3s ease;
}

.custom-naming input:focus {
    outline: none;
    border-color: #667eea;
}

.custom-naming small {
    display: block;
    margin-top: 8px;
    color: #666;
    font-size: 0.85em;
}

.quality-section {
    margin-bottom: 30px;
}

.quality-control {
    display: flex;
    align-items: center;
    gap: 15px;
}

.quality-control input[type="range"] {
    flex: 1;
    height: 6px;
    background: #e0e0e0;
    border-radius: 3px;
    outline: none;
    -webkit-appearance: none;
}

.quality-control input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    background: #667eea;
    border-radius: 50%;
    cursor: pointer;
}

.quality-control input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: #667eea;
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

#qualityValue {
    font-weight: 600;
    color: #667eea;
    min-width: 40px;
}

.convert-btn {
    width: 100%;
    padding: 18px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 15px;
    font-size: 1.2em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.convert-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s ease;
}

.convert-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 35px rgba(102, 126, 234, 0.4);
    background: linear-gradient(135deg, #5a6fd8 0%, #6b5b95 100%);
}

.convert-btn:hover::before {
    left: 100%;
}

.convert-btn:active {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}

.convert-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    background: #ccc;
}

.convert-btn:disabled::before {
    display: none;
}

.preview-section, .download-section {
    padding: 40px;
    border-top: 1px solid #eee;
}

.preview-grid, .download-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.preview-item {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.preview-item:hover {
    transform: translateY(-5px);
}

.preview-item img {
    width: 100%;
    height: 150px;
    object-fit: cover;
}

.preview-info {
    padding: 15px;
}

.preview-info h4 {
    margin-bottom: 5px;
    color: #333;
    font-size: 0.9em;
}

.preview-info p {
    color: #666;
    font-size: 0.8em;
    margin-bottom: 3px;
}

.download-item {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    text-align: center;
    transition: transform 0.3s ease;
}

.download-item:hover {
    transform: translateY(-5px);
}

.download-btn {
    padding: 10px 20px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9em;
    transition: background 0.3s ease;
}

.download-btn:hover {
    background: #5a6fd8;
}

.download-all-btn {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.download-all-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(40, 167, 69, 0.3);
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: #e0e0e0;
    border-radius: 3px;
    overflow: hidden;
    margin: 10px 0;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    width: 0%;
    transition: width 0.3s ease;
}

/* 通知系统样式 */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    min-width: 300px;
    max-width: 500px;
    z-index: 1000;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
    animation: slideInRight 0.3s ease-out;
}

.notification-content {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    gap: 12px;
}

.notification-icon {
    font-size: 1.2em;
    font-weight: bold;
    min-width: 20px;
}

.notification-message {
    flex: 1;
    font-size: 0.95em;
    line-height: 1.4;
    white-space: pre-line;
}

.notification-close {
    background: none;
    border: none;
    font-size: 1.5em;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s ease;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.notification-close:hover {
    opacity: 1;
}

.notification-success {
    background: linear-gradient(135deg, rgba(40, 167, 69, 0.95), rgba(32, 201, 151, 0.95));
    color: white;
    border-left: 4px solid #28a745;
}

.notification-error {
    background: linear-gradient(135deg, rgba(220, 53, 69, 0.95), rgba(255, 99, 132, 0.95));
    color: white;
    border-left: 4px solid #dc3545;
}

.notification-warning {
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.95), rgba(255, 159, 64, 0.95));
    color: #333;
    border-left: 4px solid #ffc107;
}

.notification-info {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.95), rgba(118, 75, 162, 0.95));
    color: white;
    border-left: 4px solid #667eea;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* 进度条容器样式 */
.progress-container {
    margin: 20px 0;
    padding: 20px;
    background: linear-gradient(145deg, #f8f9ff 0%, #ffffff 100%);
    border-radius: 15px;
    border: 1px solid #e0e7ff;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    font-size: 0.9em;
}

.progress-info span:first-child {
    color: #333;
    font-weight: 500;
}

.progress-info span:last-child {
    color: #667eea;
    font-weight: 600;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e0e7ff;
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 4px;
    position: relative;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: progressShine 2s ease-in-out infinite;
}

@keyframes progressShine {
    0% { transform: translateX(-100%); }
    50% { transform: translateX(100%); }
    100% { transform: translateX(100%); }
}

@media (max-width: 768px) {
    .container {
        margin: 10px;
        border-radius: 15px;
        padding: 15px;
    }
    
    h1 {
        font-size: 1.8rem;
        padding: 20px;
    }
    
    .upload-section, .settings-section, .preview-section, .download-section {
        padding: 20px;
    }
    
    .upload-area {
        padding: 30px 15px;
        min-height: 120px;
        /* 移动端触摸优化 */
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
        user-select: none;
        -webkit-user-select: none;
    }

    .upload-area:active {
        transform: scale(0.98);
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    }
    
    .format-options, .naming-options {
        flex-direction: column;
        gap: 10px;
    }
    
    .controls {
        flex-direction: column;
        gap: 15px;
    }

    .control-group {
        width: 100%;
    }

    .convert-btn {
        width: 100%;
        padding: 18px;
        font-size: 1.2rem;
        min-height: 56px; /* 符合移动端最小触摸目标 */
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
    }

    .convert-btn:active {
        transform: scale(0.95);
    }
    
    .preview-grid, .download-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 15px;
    }
    
    .download-item {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }

    .download-btn {
        width: 100%;
        min-height: 48px;
        padding: 12px 20px;
        font-size: 1rem;
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
    }

    .download-btn:active {
        transform: scale(0.95);
    }
    
    .notification {
        left: 10px;
        right: 10px;
        min-width: auto;
    }
    
    .progress-container {
         margin: 15px 0;
         padding: 15px;
     }

    .mobile-download-modal .modal-content {
        margin: 10px;
        max-width: calc(100% - 20px);
    }

    .modal-body img {
        max-width: 100%;
        max-height: 50vh;
    }

    /* 质量滑块移动端优化 */
    .quality-slider {
        height: 8px;
        -webkit-appearance: none;
        appearance: none;
    }

    .quality-slider::-webkit-slider-thumb {
        width: 24px;
        height: 24px;
        -webkit-appearance: none;
        appearance: none;
        background: #667eea;
        border-radius: 50%;
        cursor: pointer;
        box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    }

    .quality-slider::-moz-range-thumb {
        width: 24px;
        height: 24px;
        background: #667eea;
        border-radius: 50%;
        cursor: pointer;
        border: none;
        box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    }

    /* 单选按钮移动端优化 */
    .radio-group label {
        padding: 12px 16px;
        min-height: 48px;
        display: flex;
        align-items: center;
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
    }

    .radio-group input[type="radio"] {
        width: 20px;
        height: 20px;
        margin-right: 12px;
    }

    /* 防止移动端页面缩放 */
    * {
        -webkit-touch-callout: none;
        -webkit-user-select: none;
        -khtml-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
        user-select: none;
    }

    input, textarea {
        -webkit-user-select: text;
        -khtml-user-select: text;
        -moz-user-select: text;
        -ms-user-select: text;
        user-select: text;
    }
 }
 
 /* 移动端下载模态框样式 */
 .mobile-download-modal {
     position: fixed;
     top: 0;
     left: 0;
     width: 100%;
     height: 100%;
     background: rgba(0, 0, 0, 0.8);
     backdrop-filter: blur(10px);
     display: flex;
     justify-content: center;
     align-items: center;
     z-index: 10000;
     animation: modalFadeIn 0.3s ease-out;
     padding: 20px;
     box-sizing: border-box;
 }

 /* 内置浏览器专用模态框 */
  .mobile-download-modal.in-app-browser {
      background: rgba(0, 0, 0, 0.9);
  }
  
  /* 微信专用保存模态框 */
  .mobile-download-modal.wechat-save {
      background: rgba(0, 0, 0, 0.95);
  }
  
  .mobile-download-modal.wechat-save .modal-content {
      background: linear-gradient(135deg, #07c160 0%, #00d4aa 100%);
      color: white;
      border: 2px solid rgba(255, 255, 255, 0.3);
      max-height: 90vh;
      overflow-y: auto;
  }
  
  .mobile-download-modal.wechat-save .modal-header h3 {
      color: white;
      text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
      font-size: 18px;
  }
  
  .mobile-download-modal.wechat-save .modal-close {
      background: rgba(255, 255, 255, 0.2);
      color: white;
      border: 1px solid rgba(255, 255, 255, 0.3);
  }
  
  .mobile-download-modal.wechat-save .modal-close:hover {
      background: rgba(255, 255, 255, 0.3);
  }
  
  /* 微信提醒样式 */
  .wechat-notice {
      background: rgba(255, 255, 255, 0.15);
      border: 1px solid rgba(255, 255, 255, 0.3);
      border-radius: 8px;
      padding: 12px;
      margin-bottom: 16px;
      text-align: center;
  }
  
  .wechat-notice .notice-text {
      margin: 0;
      font-weight: 500;
      color: white;
      font-size: 14px;
  }
  
  /* 微信指导步骤样式 */
  .wechat-instructions {
      background: rgba(255, 255, 255, 0.1);
      border-radius: 8px;
      padding: 16px;
      margin: 16px 0;
  }
  
  .instruction-title {
      margin: 0 0 12px 0;
      font-size: 16px;
      color: white;
      border-bottom: 1px solid rgba(255, 255, 255, 0.2);
      padding-bottom: 8px;
  }
  
  .instruction-step {
      display: flex;
      align-items: center;
      margin: 10px 0;
      padding: 8px;
      background: rgba(255, 255, 255, 0.05);
      border-radius: 6px;
  }
  
  .step-number {
      background: rgba(255, 255, 255, 0.2);
      color: white;
      width: 24px;
      height: 24px;
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      font-weight: bold;
      font-size: 12px;
      margin-right: 12px;
      flex-shrink: 0;
  }
  
  .step-text {
      color: rgba(255, 255, 255, 0.9);
      font-size: 14px;
      line-height: 1.4;
  }
  
  /* 微信模态框中的按钮样式 */
  .mobile-download-modal.wechat-save .action-btn.primary {
      background: linear-gradient(45deg, #ff6b6b, #ee5a24);
      border: 1px solid rgba(255, 255, 255, 0.3);
      font-weight: 600;
  }
  
  .mobile-download-modal.wechat-save .action-btn.secondary {
      background: linear-gradient(45deg, #4834d4, #686de0);
      border: 1px solid rgba(255, 255, 255, 0.3);
  }
  
  .mobile-download-modal.wechat-save .action-btn.tertiary {
      background: linear-gradient(45deg, #95a5a6, #7f8c8d);
      border: 1px solid rgba(255, 255, 255, 0.3);
  }
  
  .mobile-download-modal.wechat-save .wechat-tips {
      background: rgba(255, 255, 255, 0.1);
      border: 1px solid rgba(255, 255, 255, 0.2);
      border-radius: 8px;
      padding: 12px;
      margin-top: 16px;
  }
  
  .mobile-download-modal.wechat-save .tip-title {
      color: #fff3cd;
      margin: 0 0 8px 0;
      font-weight: 500;
  }
  
  .mobile-download-modal.wechat-save .tip-item {
      color: rgba(255, 255, 255, 0.8);
      margin: 4px 0;
      font-size: 13px;
  }
  
  /* 图片容器样式 */
  .mobile-download-modal.wechat-save .image-container {
      margin: 16px 0;
      text-align: center;
  }
  
  .mobile-download-modal.wechat-save #wechatSaveImage {
      transition: transform 0.2s ease;
  }
  
  .mobile-download-modal.wechat-save #wechatSaveImage:active {
       transform: scale(0.98);
   }
   
   /* 微信模态框按钮布局优化 */
   .mobile-download-modal.wechat-save .modal-actions {
       display: grid;
       grid-template-columns: 1fr 1fr;
       gap: 8px;
       margin: 16px 0;
   }
   
   .mobile-download-modal.wechat-save .action-btn {
       font-size: 13px;
       padding: 10px 8px;
       min-height: 44px;
       display: flex;
       align-items: center;
       justify-content: center;
       text-align: center;
       transition: all 0.3s ease;
   }
   
   .mobile-download-modal.wechat-save .action-btn:active {
       transform: scale(0.95);
   }

 .mobile-download-modal.in-app-browser .modal-content {
     background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
     color: white;
     border: 2px solid rgba(255, 255, 255, 0.2);
 }

 .mobile-download-modal.in-app-browser .modal-header h3 {
     color: white;
     text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
 }

 .mobile-download-modal.in-app-browser .modal-close {
     background: rgba(255, 255, 255, 0.2);
     color: white;
     border: 1px solid rgba(255, 255, 255, 0.3);
 }

 .mobile-download-modal.in-app-browser .modal-close:hover {
     background: rgba(255, 255, 255, 0.3);
 }

 /* 浏览器提醒样式 */
 .browser-notice {
     background: rgba(255, 193, 7, 0.2);
     border: 1px solid rgba(255, 193, 7, 0.5);
     border-radius: 8px;
     padding: 12px;
     margin-bottom: 16px;
     text-align: center;
 }

 .notice-text {
     margin: 0;
     font-weight: 500;
     color: #fff3cd;
 }

 /* 内置浏览器模态框中的按钮样式 */
 .mobile-download-modal.in-app-browser .action-btn.primary {
     background: linear-gradient(45deg, #28a745, #20c997);
     border: 1px solid rgba(255, 255, 255, 0.3);
 }

 .mobile-download-modal.in-app-browser .action-btn.secondary {
     background: linear-gradient(45deg, #17a2b8, #6f42c1);
     border: 1px solid rgba(255, 255, 255, 0.3);
 }

 .mobile-download-modal.in-app-browser .action-btn.tertiary {
     background: linear-gradient(45deg, #6c757d, #495057);
     border: 1px solid rgba(255, 255, 255, 0.3);
 }

 .mobile-download-modal.in-app-browser .download-tips {
     background: rgba(255, 255, 255, 0.1);
     border: 1px solid rgba(255, 255, 255, 0.2);
 }

 .mobile-download-modal.in-app-browser .tip-title {
     color: #fff3cd;
 }

 .mobile-download-modal.in-app-browser .tip-item {
     color: rgba(255, 255, 255, 0.9);
 }
 
 .modal-content {
     background: white;
     border-radius: 20px;
     max-width: 400px;
     width: 100%;
     max-height: 90vh;
     overflow-y: auto;
     box-shadow: 0 25px 50px rgba(0, 0, 0, 0.4);
     animation: modalSlideIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
 }
 
 .modal-header {
     background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
     color: white;
     padding: 20px;
     display: flex;
     justify-content: space-between;
     align-items: center;
     border-radius: 20px 20px 0 0;
 }
 
 .modal-header h3 {
     margin: 0;
     font-size: 1.3rem;
     font-weight: 600;
 }
 
 .modal-close {
     background: rgba(255, 255, 255, 0.2);
     border: none;
     color: white;
     font-size: 1.5rem;
     cursor: pointer;
     padding: 0;
     width: 35px;
     height: 35px;
     display: flex;
     align-items: center;
     justify-content: center;
     border-radius: 50%;
     transition: all 0.2s;
     -webkit-tap-highlight-color: transparent;
 }
 
 .modal-close:hover,
 .modal-close:active {
     background-color: rgba(255, 255, 255, 0.3);
     transform: scale(1.1);
 }
 
 .modal-body {
     padding: 25px;
     text-align: center;
 }
 
 .modal-body img {
     max-width: 100%;
     height: auto;
     margin-bottom: 20px;
     transition: transform 0.2s;
     cursor: pointer;
 }
 
 .save-instructions {
     background: linear-gradient(135deg, #f8f9ff 0%, #e8f2ff 100%);
     border-radius: 12px;
     padding: 15px;
     margin: 15px 0;
     border-left: 4px solid #667eea;
 }

 .mobile-download-modal.in-app-browser .save-instructions {
     background: rgba(255, 255, 255, 0.1);
     border-radius: 8px;
     padding: 16px;
     margin: 16px 0;
     border-left: 4px solid rgba(255, 255, 255, 0.3);
 }
 
 .save-instruction {
     color: #555;
     margin: 8px 0;
     font-size: 0.95rem;
     line-height: 1.5;
     text-align: left;
 }
 
 .save-instruction.primary {
     color: #333;
     font-size: 1.05rem;
     margin-bottom: 12px;
     text-align: center;
 }

 .mobile-download-modal.in-app-browser .save-instruction.primary {
     font-size: 16px;
     margin-bottom: 12px;
     border-bottom: 1px solid rgba(255, 255, 255, 0.2);
     padding-bottom: 8px;
     color: white;
 }

 .mobile-download-modal.in-app-browser .save-instruction {
     color: rgba(255, 255, 255, 0.9);
 }
 
 .file-name {
     color: #333;
     font-weight: 500;
     margin: 20px 0;
     padding: 12px 15px;
     background: linear-gradient(135deg, #f0f4f8 0%, #e8f2ff 100%);
     border-radius: 10px;
     font-size: 0.9rem;
     border: 1px solid #e1e8ed;
 }
 
 .modal-actions {
      margin: 20px 0;
      display: flex;
      flex-wrap: wrap;
      gap: 10px;
      justify-content: center;
  }
  
  .action-btn {
      border: none;
      padding: 10px 16px;
      border-radius: 20px;
      font-size: 0.85rem;
      font-weight: 500;
      cursor: pointer;
      transition: all 0.3s;
      -webkit-tap-highlight-color: transparent;
      touch-action: manipulation;
      flex: 1;
      min-width: 80px;
      max-width: 120px;
  }
  
  .action-btn.primary {
      background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
      color: white;
      box-shadow: 0 3px 12px rgba(102, 126, 234, 0.3);
  }
  
  .action-btn.secondary {
      background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
      color: white;
      box-shadow: 0 3px 12px rgba(79, 172, 254, 0.3);
  }
  
  .action-btn.tertiary {
      background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
      color: white;
      box-shadow: 0 3px 12px rgba(250, 112, 154, 0.3);
  }
  
  .action-btn:hover,
  .action-btn:active {
      transform: translateY(-1px);
      box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
  }
  
  .download-tips {
      margin-top: 20px;
      padding: 15px;
      background: linear-gradient(135deg, #fff5f5 0%, #ffe8e8 100%);
      border-radius: 12px;
      border-left: 4px solid #ff6b6b;
      text-align: left;
  }
  
  .tip-title {
      color: #d63031;
      font-weight: 600;
      margin: 0 0 10px 0;
      font-size: 0.95rem;
  }
  
  .tip-item {
      color: #636e72;
      margin: 5px 0;
      font-size: 0.85rem;
      line-height: 1.4;
  }
 
 @keyframes modalFadeIn {
     from {
         opacity: 0;
     }
     to {
         opacity: 1;
     }
 }
 
 @keyframes modalSlideIn {
     from {
         transform: scale(0.7) translateY(30px);
         opacity: 0;
     }
     to {
         transform: scale(1) translateY(0);
         opacity: 1;
     }
 }
 
 /* 移动端特殊优化 */
 @media (max-width: 768px) {
     .mobile-download-modal {
         padding: 10px;
     }
     
     .modal-content {
         max-width: 95vw;
         max-height: 95vh;
     }
     
     .modal-header {
         padding: 15px 20px;
     }
     
     .modal-header h3 {
         font-size: 1.1em;
     }
     
     .modal-body {
         padding: 20px;
     }
     
     .save-instruction {
         font-size: 1em;
         padding: 12px;
     }
 }